home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / doc / clippings / 911211-01 < prev    next >
Encoding:
Internet Message Format  |  1992-01-09  |  7.2 KB

  1. Date: Wed, 11 Dec 1991 11:28:30 +0100
  2. From: "(Alain Brossard EPFL-SIC/SII)" <brossard@sasun1.epfl.ch>
  3. Message-Id: <9112111028.AA00423@sasun1.epfl.ch>
  4. To: sun-managers@eecs.nwu.edu
  5. Subject: Information: NIS and password security
  6.  
  7.    For those who missed it in alt.security, I reproduced
  8. below a security warning on NIS.  After contacting Peter Lamb, 
  9. he provided me with a patch he got from Purdue originally, 
  10. I fixed it up, modified it a bit, added a man page and recompiled ypserv 
  11. >From the 4.1.1 sources.  Since I can't distribute the sources, I'm
  12. making available (for those who trust me :-) the binaries on litsun:pub/yp.uu.
  13.    It is a uuencoded version of ypserv.tar.Z which includes
  14. sun[34]/ypserv, ypserv.8 and hosts.nis.5.  The file hosts.nis contains
  15. a list of subnets and hosts which are allowed to connect to the
  16. NIS server.  No other hosts will be able to get any maps (including
  17. the password file!).
  18.  
  19.                     Alain Brossard
  20.                     brossard@sic.epfl.ch
  21.  
  22. In article <prl.691873839@iis>, prl@iis.ethz.ch (Peter Lamb) writes:
  23. |> There have been a number of queries and some not completely accurate
  24. |> information posted on this question. I'll try to summarise the problem and
  25. |> suggested workarounds. None of the workarounds is particularly satisfactory,
  26. |> and I'll try to give a reasonable summary of the pros and cons.
  27. |> 
  28. |> The problem is this: ypserv is totally indiscriminate about which machines
  29. |> it will respond to queries from. Normal NIS maps can be read by anyone 
  30. |> on the Internet who can route packets to your NIS server and back.
  31. |> "secure" (HA!) NIS maps like passwd.adjunct can only be read if the querier
  32. |> is using a privileged port (< 1024). This means that anyone can read your
  33. |> "secure" maps if they can crack root on some machine on the Internet
  34. |> and can route packets to your machine.
  35. |> 
  36. |> The bug means that many machines on the Internet which use NIS are
  37. |> vulnerable to having their password files stolen and run through "Crack" or
  38. |> similar. Arguments about whether distributing Crack and fast U*ix encryption
  39. |> algorithms was a good idea aside, every wannabe cracker now has a copy
  40. |> of a reasonably state-of-the-art password guesser.
  41. |> 
  42. |> As I said in my earlier post on this subject, the combination "I'm NIS
  43. |> and I serve everyone" and easily available password guessers has already
  44. |> led to breakins at some sites.
  45. |> 
  46. |> This bug was reported to Sun in April 1990, and CERT has also been aware
  47. |> of it for about the same length of time.
  48. |> 
  49. |> I am told that the bug will be fixed in NIS+ or NIS3.0, or whatever it's
  50. |> called this week, which I understand will be available in Solaris 2.0.
  51. |> 
  52. |> 
  53. |> What to do about it:
  54. |> 
  55. |> 1) The Sun Party Line. "Don't run ypserv on your gateway and disable
  56. |>    IP forwarding on the gateway". This is commonly known as a
  57. |>    "firewall" (provided the machine is also in other respects
  58. |>    reasonably secure) and is probably already done by many commercial
  59. |>    users of the Internet. It is not the greatest in convenience, and
  60. |>    most University sysadmins would encounter, lets say, a little user
  61. |>    resistance. Managing the gateway is also a pain.  Switching off
  62. |>    `routed' alone, as has been suggested here, is usually insufficient.
  63. |>    However, provided the security of the firewall is not breached, you
  64. |>    are safe from this attack, and many others. Instructions on how
  65. |>    to disable IP forwarding in the kernel are in Sun's Network Admin
  66. |>    manual.
  67. |> 
  68. |> 2) The Lamb Party Line. If you communicate to the outside world through a
  69. |>    smart router, filter out packets coming from external connections
  70. |>    addressed to destination ports sunrpc/udp&tcp (port 111) and ports
  71. |>    600-1023, tcp&udp. This will prevent access to *all* sunrpc services
  72. |>    from outside the router. It will also block access to the Kerberos
  73. |>    protocols (probably also not a bad idea given the info. in Steve
  74. |>    Bellovin's paper about Kerberos security problems), and will
  75. |>    probably block the BSD `r' (rcp,rlogin, etc) commands, but don't
  76. |>    count on it doing so.  If you and your router are smart enough, you
  77. |>    may be able to make the `r' commands work.  Eg, for rlogin, allow
  78. |>    the packets through iff their source is 513/tcp (this opens up a hole
  79. |>    for a sufficiently clever cracker, though). Blocking port 111 alone
  80. |>    is insufficient but will block the most obvious attacks (including
  81. |>    those I've been told have already actually occurred).
  82. |> 
  83. |> The above two solutions are the only real answers to the problem. There
  84. |> are some workarounds which make life harder for the potential cracker.
  85. |> 
  86. |> 1) Choose a hard-to-guess NIS domain name. The cracker must be able to guess
  87. |>    your NIS domain name in order to talk to ypserv. This is purest security-
  88. |>    through-obscurity. The domain name is normally only handled by
  89. |>    automatic systems, and can be up to 64 characters long. Making the first
  90. |>    part a reasonable handle may help system administration. Something like
  91. |>     my-old-domainname-Ldp.T2d9wCY
  92. |>    is probably reasonable. This precaution is vulnerable to "social
  93. |>    engineering" attacks, ie. the cracker trying to fool a user at your site
  94. |>    to reveal the domain name, since the NIS domain name can be discovered by
  95. |>    any user on your machines.
  96. |> 
  97. |> 2) Use passwd+ or npasswd to vet passwords. If you do this, you need to
  98. |>    make all your users put their current password through the new
  99. |>    password program. Using a premptive check on passwords for idiotic
  100. |>    usage is a good idea anyway, independent of whether you use NIS or
  101. |>    not.  If you have Suns and you'd rather spend money than install
  102. |>    free software, Sun Shield (TM) also provides this capability, along
  103. |>    with other more or less useful things.  Convex provides some similar
  104. |>    capabilities in their passwd(1) program.  Some other manufacturers
  105. |>    may also have similar capabilities. The more sites that do this, the more
  106. |>    frustrating it will become for crackers trying to guess passwords.
  107. |> 
  108. |> 
  109. |> 
  110. |> Note that this problem is common to all versions of NIS or Yellow Pages,
  111. |> that I know of not just on Suns. It will probably go away in NIS+ aka NIS3.0,
  112. |> but it seems that this will be a little while coming, and for non-Sun
  113. |> machines even further off.
  114. |> 
  115. |> Using NIS in combination with Sun's so-called `C2' security will *not* help.
  116. |> 
  117. |> For those not aware of current technology in password guessing programs,
  118. |> Alan Muffet (?sp) "Crack" program can test > 500 guesses/sec against
  119. |> a U*ix encrypted password on any modern RISC workstation. This means that 
  120. |> an encrypted password can be checked against the entire /usr/dict/words
  121. |> in less than a minute. "Crack" has been posted to the network, and you
  122. |> can assume that most crackers and wannabe's have a copy.
  123. |> 
  124. |> 
  125. |> Peter Lamb (prl@iis.ethz.ch) (depressed)
  126. |> 
  127. |> 
  128. |> PS: Sorry, I will not respond to requests for more details about how to
  129. |>     exploit this hole. Sun and CERT have full details. If you have a Sun
  130. |>     s/w maintenance contract, the escalation SO# was 484666 and the Sun BugId
  131. |>     was 1036869. Please contact Sun if you feel you need more details.
  132.  
  133. -- 
  134.  
  135. Alain Brossard, Ecole Polytechnique Federale de Lausanne,
  136.     SIC/SII, EL-Ecublens, CH-1015 Lausanne, Suisse, +41 21 693-2211
  137. brossard@sic.epfl.ch
  138.  
  139.